// *************************************************************************************************
//
// MK3D Engine
// --------------------------------------
// Copyright (C) 2007-2011 Zeb (mailto: zebbey@gmail.com)
//
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//
// *************************************************************************************************

#ifndef __H_MK_TERRAIN_LAYER_BRUSH__
#define __H_MK_TERRAIN_LAYER_BRUSH__

#include "mk_transformation.h"

namespace MK3DE
{
	class CTexture2D;
	class CImage;
	class CEntityTerrain;

	class MK3DE_API CTerrainLayerBrush : public CTransformation
	{
	public:
		CTerrainLayerBrush();
		~CTerrainLayerBrush();

	public:
		void Paint(CTexture2D* pTexture, int layer, float x, float y);

		BOOL LoadImage(const char* fileName, DWORD width, DWORD height);

		float GetSize() { return _size; }
		void SetSize(float size) { _size = size; }

		float GetPowerFactor() { return _powerFactor; }
		void SetPowerFactor(float power) { _powerFactor = power; }

		void GetPosition(float& x, float& y) { x = _x; y = _y; }
		void SetPosition(float x, float y) { _x = x; _y = y; }

		void Render(CEntityTerrain* terrain);

	private:
		void __ProcessChannel(DWORD& color, DWORD& a, DWORD& b, DWORD& c, DWORD d);

	private:
		float _size;
		float _powerFactor;
		float _x;
		float _y;

		CImage* _brushImage;
	};
};

#endif // __H_MK_TERRAIN_LAYER_BRUSH__